package com.fire.control.system.module.device.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.fire.control.system.entity.User;

/**
 * @author liuxincheng
 * @ClassName: ChargePersonRepository
 * @Description: TODO(负责人持久层)
 * @date 2017年5月11日 上午9:31:14
 */
@Repository
public interface ChargePersonRepository extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {

	@Modifying(clearAutomatically = true)
	@Query("update DeviceGroup d set d.status =:status where d.id =:id")
	public int switchChagePerson(@Param("status")boolean status,@Param("id")String id);
	
}
